$(document).ready(function (){
	$('#school_pList').click( function() {
		$('#school_cList').html('');
		var str='';
		for (var i=0; i<this.options.length; i++){
  			if (this.options[i].selected){
  				if (this.options[i].value!=0){
	  				str+=this.options[i].value;
	  				str+=','
  				}
  			}
		}
		if (str.length>0){
			$.ajax({
			 type: "POST",
			 url: "./?ctrl=schooltypes&action=getCtypes",
			 data:   "pids="+str.substr(0,str.length-1),
			 success: function(msg){
			 	var clist=eval(msg);
			 	for (var i=0 ; i < clist.length ;i++){
			 		$('#school_cList').append('<option value="'+clist[i]['id']+'">['+$("option[@value="+clist[i]['pid']+"]").html()+']'+clist[i]['title']+'</option>');
			 	}
			 } 
			}); 
		}
	});
});